import { defineStore } from "pinia";

export const useUserInfoStore = defineStore('userInfoStore', {
    //开启持久化
    persist: true,
    state: () => {
        return { userToken: '', userId: '' }
    },
    actions: {
        setUserToken(payload: string) {
            console.log('payload', payload);
            this.userToken = payload;
        },
        setUserId(payload: string) {
            console.log('payload', payload);
            this.userId = payload
        }
    },
    getters: {
        getUserToken(): string {
            return this.userToken
        },
        getUserId(): string {
            return this.userId
        }
    }
})

